Operations:

Format

Syntax:

Operation:

Operands:

Architecture revision

Opcode

1

pavg.ub Rd, Rx, Ry

Rd[31:24] = LSR(ZE(Rx[31:24], 9) + ZE(Ry[31:24], 9) + 1, 1); 
Rd[23:16] = LSR(ZE(Rx[23:16], 9) + ZE(Ry[23:16], 9) + 1, 1);
Rd[15:8] = LSR(ZE(Rx[15:8], 9) + ZE(Ry[15:8], 9) + 1, 1);
Rd[7:0] = LSR(ZE(Rx[7:0], 9) + ZE(Ry[7:0], 9) + 1, 1);
{d, x, y} ∈ {0, 1, …, 15}

Rev1+

111

Rx

00000

Ry

001000111100

Rd

3

4

5

4

12

4

2

pavg.sh Rd, Rx, Ry

Rd[31:16] = ASR(SE(Rx[31:16], 17) + SE(Ry[31:16], 17) + 1, 1);
Rd[15:0] = ASR(SE(Rx[15:0], 17) + SE(Ry[15:0], 17) + 1, 1);
{d, x, y} ∈ {0, 1, …, 15}

Rev1+

111

Rx

00000

Ry

001000111101

Rd

3

4

5

4

12

4

Description

Computes the average of pairs of packed unsigned bytes (pavg.ub) or packed signed halfwords (pavg.sh). The averages are computed by adding two values together while also adding in a rounding factor in the least significant bit. The result is then halved by shifting it one position to the right.

Status Flags:

Q:

Not affected.

V:

Not affected.

N:

Not affected.

Z:

Not affected.

C:

Not affected.